package plataforma.crud.cih;

import nucleo.global.visao.WindowMenu;

import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.SuspendNotAllowedException;



public class JanListagem extends org.zkoss.zul.Window{
	

	private static final long serialVersionUID = -5859724805082908994L;
	/** Tamanho da window. */
	protected String WIDTH_WINDOW = "450px";
	
	protected String HEIGHT_WINDOW = "750px";

	
	
	public JanListagem(){
		 configurarPropriedadesPadrao();
	
	}

	
	protected void configurarPropriedadesPadrao() {

		this.setContentStyle("overflow:auto;background:white");	
		this.setTitle(getTituloWindow());
		this.setBorder("normal");
		this.setClosable(true);
		this.setWidth(WIDTH_WINDOW);
		this.setPosition("center");
		this.setZIndex(10);
		setMaximizable(true);							
	}

	
	@Override
	public void onClose() {
	System.out.println("Fechou a janela");
		super.onClose();
	}


	protected String getTituloWindow() {		
		return getTitle();
	}

	
	public void mostrar() {
		try {
			doOverlapped();
			WindowMenu wPrincipal =(WindowMenu)	Executions.getCurrent().getDesktop().getFirstPage().getFellow("WindowMenu");
			this.setParent(wPrincipal);
		} catch (SuspendNotAllowedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	

}
